package exam.day25;

import java.util.Scanner;

public class Test2 {
    public static boolean hostschedule (int[][] schedule) {
        // write code here
        int n = schedule.length;
        for(int i = 0; i < n - 1; i++) {
            for(int j = 0; j < n - 1; j++) {
                if(schedule[j][0] > schedule[j+1][0]) {
                    int[] tmp = schedule[j];
                    schedule[j] = schedule[j+1];
                    schedule[j+1] = tmp;
                }
            }
        }

        for(int i = 0; i < n - 1; i++) {
            if(schedule[i][1] > schedule[i+1][0]) {
                return false;
            }
        }
        return true;
    }

    public static void main(String[] args) {
        int[][] schedule = {{0, 10}, {20, 30}, {10, 20}};
        System.out.println(hostschedule(schedule));
    }
}
